Skip to content

Conversation

rjp
Copy link

@rjp rjp commented Apr 2, 2025

Support for -v -v -v, -vvv, and -v=3 options on an int-like field.

Fixes: #213
Fixes: #170

rjp added 2 commits April 2, 2025 12:41
+ Adds a tag `repeated` which allows `-v -v -v`, `-vvv`, or `-v=5` to
  set an `int` field.
+ Field type must satisfy `reflect.CanInt()`.
+ `spec` gains `noarg` (forces cardinality of 0) and `repeated` flags.
+ Short option must be provided if the field is more than one character
  long.
+ Reasonably comprehensive tests.

+ Maybe allow defaulting the short option to the first character of
  the field name if not provided?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Verbose option Repeated flags not detected....

1 participant